package com.bootdo.appsystem.domain;

import com.bootdo.app.utils.AmountUtil;

import java.io.Serializable;
import java.util.Date;



/**
 * 
 * 
 * @author chglee
 * @email 806181255@qq.com
 * @date 2018-06-10 20:24:44
 */
public class OrderhongbaoDO implements Serializable {
	private static final long serialVersionUID = 1L;
	
	//订单红包奖励表主键
	private Integer id;
	//订单编号
	private String ddcode;
	//会员编号
	private Integer uid;
	//会员编号
	private Integer selleruserid;
	//奖励会员总红包
	private Double usermoney;
	//已奖励会员红包
	private Double backusermoney;
	//奖励商家总红包
	private Double sellermoney;
	//已奖励商家红包
	private Double backsellermoney;
	//红包状态
	private Integer orderstatus;
	//订单速率
	private Double ratio;
	//用户系数
	private Double userxishu;
	//商家系数
	private Double sellerxishu;
	//商家订单系数
	private Double sellerorderxishu;
	//订单折扣
	private Double sellercost;
	//订单时间
	private Date ordertime;

	public Date getOrdertime() {
		return ordertime;
	}
	public void setOrdertime(Date ordertime) {
		this.ordertime = ordertime;
	}

	public Double getSellercost() {
		return sellercost;
	}

	public void setSellercost(Double sellercost) {
		this.sellercost = sellercost;
	}

	/**
	 * 设置：订单红包奖励表主键
	 */
	public void setId(Integer id) {
		this.id = id;
	}
	/**
	 * 获取：订单红包奖励表主键
	 */
	public Integer getId() {
		return id;
	}
	/**
	 * 设置：订单编号
	 */
	public void setDdcode(String ddcode) {
		this.ddcode = ddcode;
	}
	/**
	 * 获取：订单编号
	 */
	public String getDdcode() {
		return ddcode;
	}
	/**
	 * 设置：会员编号
	 */
	public void setUid(Integer uid) {
		this.uid = uid;
	}
	/**
	 * 获取：会员编号
	 */
	public Integer getUid() {
		return uid;
	}
	/**
	 * 设置：会员编号
	 */
	public void setSelleruserid(Integer selleruserid) {
		this.selleruserid = selleruserid;
	}
	/**
	 * 获取：会员编号
	 */
	public Integer getSelleruserid() {
		return selleruserid;
	}
	/**
	 * 设置：奖励会员总红包
	 */
	public void setUsermoney(Double usermoney) {
		this.usermoney = usermoney;
	}
	/**
	 * 获取：奖励会员总红包
	 */
	public Double getUsermoney() {
		return usermoney;
	}
	/**
	 * 设置：已奖励会员红包
	 */
	public void setBackusermoney(Double backusermoney) {
		this.backusermoney = backusermoney;
	}
	/**
	 * 获取：已奖励会员红包
	 */
	public Double getBackusermoney() {
		return backusermoney;
	}
	/**
	 * 设置：奖励商家总红包
	 */
	public void setSellermoney(Double sellermoney) {
		this.sellermoney = sellermoney;
	}
	/**
	 * 获取：奖励商家总红包
	 */
	public Double getSellermoney() {
		return sellermoney;
	}
	/**
	 * 设置：已奖励商家红包
	 */
	public void setBacksellermoney(Double backsellermoney) {
		this.backsellermoney = backsellermoney;
	}
	/**
	 * 获取：已奖励商家红包
	 */
	public Double getBacksellermoney() {
		return backsellermoney;
	}
	/**
	 * 设置：红包状态
	 */
	public void setOrderstatus(Integer orderstatus) {
		this.orderstatus = orderstatus;
	}
	/**
	 * 获取：红包状态
	 */
	public Integer getOrderstatus() {
		return orderstatus;
	}
	/**
	 * 设置：订单速率
	 */
	public void setRatio(Double ratio) {
		this.ratio = ratio;
	}
	/**
	 * 获取：订单速率
	 */
	public Double getRatio() {
		return ratio;
	}
	/**
	 * 设置：用户系数
	 */
	public void setUserxishu(Double userxishu) {
		this.userxishu = userxishu;
	}
	/**
	 * 获取：用户系数
	 */
	public Double getUserxishu() {
		return userxishu;
	}
	/**
	 * 设置：商家系数
	 */
	public void setSellerxishu(Double sellerxishu) {
		this.sellerxishu = sellerxishu;
	}
	/**
	 * 获取：商家系数
	 */
	public Double getSellerxishu() {
		return sellerxishu;
	}
	/**
	 * 设置：商家订单系数
	 */
	public void setSellerorderxishu(Double sellerorderxishu) {
		this.sellerorderxishu = sellerorderxishu;
	}
	/**
	 * 获取：商家订单系数
	 */
	public Double getSellerorderxishu() {
		return sellerorderxishu;
	}


	public OrderhongbaoDO creatOrderHongbaoDO(OrderproductDO orderproductDO ,SellerDO sellerDO){
		OrderhongbaoDO o = new OrderhongbaoDO();
		o.setDdcode(orderproductDO.getOrdercode());
		o.setBacksellermoney(0.0);
		o.setRatio(1.0);
		o.setOrderstatus(1);
		o.setBackusermoney(0.0);
		o.setUsermoney(orderproductDO.getTotalprice());
		o.setSellermoney(AmountUtil.multiply(orderproductDO.getTotalprice(),(10 - sellerDO.getSellercost())/10));
		o.setSelleruserid(sellerDO.getUid());
		o.setUid(orderproductDO.getUid());
		o.setSellerxishu(sellerDO.getSellerxishu());
		o.setSellerorderxishu(sellerDO.getSellerorderxishu());
		o.setSellercost(sellerDO.getSellercost());
		o.setOrdertime(orderproductDO.getOrdertime());
		return o;
	}



}
